public class factorial {
    public static int fac(int n){
        if(n == 1){
            return 1;
        }
        int tmp = n * fac(n-1);
        return tmp;
    }
    public static void main(String[] args) {
        int n = 3;
        System.out.println(fac(n));
    }
}
